<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>demo 2-37</title>
	</head>
	<body>
	</body>
	<script>
		function Counter(){
			this.num = 0;
			this.timer = setInterval(()=>{
				this.num++;
				console.log(this.num);
			},1000)
		}
		var a = new Counter();
	</script>
</html>